<!-- source: https://www.codeproject.com/Articles/45782/A-WPF-Combo-Box-with-Multiple-Selection -->
<!-- licence: OpenSource.dll-LICENSES\CPOL.htm -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf"
	xmlns:system="clr-namespace:System;assembly=mscorlib"
	xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf"
	xmlns:DentalGUIHelper="clr-namespace:DentalGUIHelper;assembly=DentalConfig"
	xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary Source="../MaterialControlStyles/MaterialDesignTheme.ComboBox.xaml"/>
	</ResourceDictionary.MergedDictionaries>
  
    <!-- Template for the toggle button which is the main view of the control -->
    <ControlTemplate x:Key="MultiSelectComboBoxToggleButtonTemplate" TargetType="{x:Type ToggleButton}">
        <Border BorderThickness="{TemplateBinding BorderThickness}"  
                    Background="{TemplateBinding Background}" 
                    BorderBrush="{TemplateBinding BorderBrush}"
                    SnapsToDevicePixels="true">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <ContentPresenter Content="{TemplateBinding Content}" />
                
                <Border Name="arrowBorder" Grid.Column="1" Width="16" BorderBrush="{TemplateBinding BorderBrush}">
                    <Path HorizontalAlignment="Center" VerticalAlignment="Center" 
                                      Fill="{TemplateBinding BorderBrush}" Data="M 0 0 L 7 0 L 3.5 4 Z" />
                </Border>
            </Grid>
        </Border>
    </ControlTemplate>


    <!-- Template for MultipleChoiceComboBox - ReadOnly implies that there may be an editable version some day.  -->
    <ControlTemplate x:Key="MultiSelectComboBoxReadOnlyTemplate" TargetType="{x:Type DentalGUIHelper:MultipleChoiceComboBox}">
        <Grid>
            <ToggleButton Name="toggleButton" IsTabStop="False"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding BorderBrush}"
                          BorderThickness="{TemplateBinding BorderThickness}"
                          Template="{StaticResource MultiSelectComboBoxToggleButtonTemplate}"
						  Style="{DynamicResource comboToggleStyle}"
                          IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen, Mode=TwoWay}" 
                          >
                <StackPanel Name="PART_labelContentPanel" IsHitTestVisible="False" Margin="4,0,5,0" Orientation="Horizontal"                                    
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
            </ToggleButton>

            <Popup Name="PART_popup" 
                   StaysOpen="False"
                   AllowsTransparency="True" 
                   Placement="Bottom"                 
                   IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen}" 
                   PopupAnimation="Slide">                
                <theme:SystemDropShadowChrome Name="Shadow" Color="Transparent" 
                                              MaxHeight="{TemplateBinding MaxDropDownHeight}" 
                                              MinWidth="{TemplateBinding ActualWidth}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" 
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Background="{TemplateBinding Background}">                       
                        <StackPanel>
                            <ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}" >
                                <ItemsPresenter Margin="{TemplateBinding Padding}" 
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </ScrollViewer>
                        </StackPanel>
                    </Border>
                </theme:SystemDropShadowChrome>
            </Popup>

        </Grid>

        <ControlTemplate.Triggers>
            <Trigger SourceName="PART_popup" Property="HasDropShadow" Value="true">
                <Setter TargetName="Shadow" Property="Margin" Value="0,0,5,5" />
                <Setter TargetName="Shadow" Property="Color" Value="{DynamicResource Gray17}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="{DynamicResource GrayBrush3}" />
            </Trigger>
            <Trigger SourceName="toggleButton" Property="IsChecked" Value="True">
                <Setter Property="BorderBrush" Value="{DynamicResource GrayBrush3}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- Style which defines the MultipleChoiceComboBox -->
    <Style x:Key="MultipleChoiceComboBoxStyle" TargetType="{x:Type DentalGUIHelper:MultipleChoiceComboBox}">
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}" />
        <Setter Property="Background" Value="{DynamicResource GrayBrush7}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="Template" Value="{StaticResource MultiSelectComboBoxReadOnlyTemplate}" />
    </Style>
	
	
	<Style x:Key="MaterialDesignFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2 2 2 2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeDashArray="1 2" StrokeThickness="1"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<ControlTemplate x:Key="MaterialDesignMultipleChoiceComboBoxItemTemplate" TargetType="{x:Type ListBoxItem}">
		<Grid x:Name="GridWrapper">
			<VisualStateManager.VisualStateGroups>
				<VisualStateGroup Name="CommonStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0:0:0.3" To="Normal">
							<VisualTransition.GeneratedEasingFunction>
								<CircleEase EasingMode="EaseOut"/>
							</VisualTransition.GeneratedEasingFunction>
						</VisualTransition>
					</VisualStateGroup.Transitions>
					<VisualState Name="Normal"/>
					<VisualState Name="MouseOver">
						<Storyboard>
							<DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To="0.1"/>
						</Storyboard>
					</VisualState>
				</VisualStateGroup>
				<VisualStateGroup Name="SelectionStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0:0:0.3"/>
					</VisualStateGroup.Transitions>
					<VisualState Name="Selected">
						<Storyboard>
							<DoubleAnimation Duration="0" Storyboard.TargetName="SelectedBorder" Storyboard.TargetProperty="Opacity" To="0.18"/>
						</Storyboard>
					</VisualState>
					<VisualState Name="Unselected"/>
				</VisualStateGroup>
				<VisualStateGroup Name="FocusStates">
					<VisualStateGroup.Transitions>
						<VisualTransition GeneratedDuration="0:0:0.05" To="Unfocused"/>
					</VisualStateGroup.Transitions>
					<VisualState Name="Focused">
						<Storyboard>
							<DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To="0.1"/>
						</Storyboard>
					</VisualState>
					<VisualState Name="Unfocused"/>
				</VisualStateGroup>
			</VisualStateManager.VisualStateGroups>
			<Border x:Name="BackBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true"/>
			<Border x:Name="MouseOverBorder" Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" BorderBrush="{TemplateBinding BorderBrush}" 
					BorderThickness="{TemplateBinding BorderThickness}" Opacity="0" SnapsToDevicePixels="true"/>
			<Border x:Name="SelectedBorder" Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" Opacity="0" RenderTransformOrigin="0.5,0.5"/>
			<wpf:Ripple HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
						VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" 
						ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" Focusable="False" 
						Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="IsEnabled" Value="False">
				<Setter TargetName="GridWrapper" Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
			</Trigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="Tag" Value="1.0"/>
					<Condition Property="IsSelected" Value="True"/>
				</MultiTrigger.Conditions>
				<Setter Property="Height" Value="0"/>
			</MultiTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<Style x:Key="MaterialDesignMultipleChoiceComboBoxItemStyle" TargetType="{x:Type ListBoxItem}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="Padding" Value="20 8 8 8"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}, FallbackValue=Stretch}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}, FallbackValue=Center}"/>
		<Setter Property="Foreground" Value="{DynamicResource MaterialDesignContextMenuForeground}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{StaticResource MaterialDesignFocusVisual}"/>
		<Setter Property="Template" Value="{StaticResource MaterialDesignMultipleChoiceComboBoxItemTemplate}"/>
	</Style>
	
	<ControlTemplate x:Key="MaterialDesignFloatingHintMultipleChoiceComboBoxTemplate" TargetType="{x:Type DentalGUIHelper:MultipleChoiceComboBox}">
		<Grid x:Name="templateRoot" Background="{TemplateBinding Background}" ToolTip="{Binding Path=ToolTip, RelativeSource={RelativeSource AncestorType={x:Type DentalGUIHelper:MultipleChoiceComboBox}}, FallbackValue={x:Null}}" SnapsToDevicePixels="True">
			<Grid x:Name="InnerRoot">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="*"/>
					<ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
				</Grid.ColumnDefinitions>
				<ToggleButton x:Name="toggleButton" ClickMode="Release" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
							  IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignRotatingComboBoxToggleButton}"/>
				<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" 
					  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
					  							  					<StackPanel Name="PART_labelContentPanel" IsHitTestVisible="False" Margin="4,0,5,0" Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
					<Grid x:Name="InputRoot" HorizontalAlignment="Left">
						<!-- <wpf:SmartHint x:Name="Hint" HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}" -->
									   <!-- FontSize="{TemplateBinding FontSize}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" UseLayoutRounding="{TemplateBinding UseLayoutRounding}"  -->
									   <!-- UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"  -->
									   <!-- FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}"  -->
									   <!-- FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}"  -->
									   <!-- HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" Hint="{TemplateBinding wpf:HintAssist.Hint}"> -->
							<!-- <wpf:SmartHint.Resources> -->
								<!-- <system:Double x:Key="DisabledOpacity">1</system:Double> -->
								<!-- TextBlock disabled opacity should not be applied on top of HintOpacity -->
							<!-- </wpf:SmartHint.Resources> -->
						<!-- </wpf:SmartHint> -->
					</Grid>
				</Grid>
				<Line x:Name="DashedLine" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Converter={StaticResource InverseBoolToVisConverter}}" 
					  StrokeThickness="1.25" StrokeDashArray="1,2.5" StrokeDashCap="Round" X1="0" X2="{Binding ActualWidth, ElementName=toggleButton}" Y1="0" Y2="0" Stroke="{TemplateBinding BorderBrush}"/>
				<wpf:Underline x:Name="Underline" Grid.ColumnSpan="2" IsActive="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen}" 
							   Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/>
				<wpf:ComboBoxPopup x:Name="PART_popup" StaysOpen="False" AllowsTransparency="true" Background="{DynamicResource MaterialDesignContextMenuBackground}" Focusable="False" HorizontalOffset="-11.5" 
								   IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" PlacementTarget="{Binding ElementName=templateRoot}" SnapsToDevicePixels="True" 
								   UseLayoutRounding="True" Placement="Custom" PopupAnimation="Fade" VerticalOffset="0" DefaultVerticalOffset="5" DownVerticalOffset="-15.5" UpVerticalOffset="15" 
								   ClassicMode="{Binding Path=(wpf:ComboBoxAssist.ClassicMode), RelativeSource={RelativeSource TemplatedParent}}" UpContentTemplate="{StaticResource PopupContentUpTemplate}" 
								   DownContentTemplate="{StaticResource PopupContentDownTemplate}" ClassicContentTemplate="{StaticResource PopupContentClassicTemplate}">
					<ContentControl>
						<GroupBox x:Name="ItemContainerGroupBox" Style="{DynamicResource MaterialDesignFlatGroupBox}" Padding="0" MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
							<ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}" Background="{DynamicResource MaterialDesignContextMenuBackground}">
								<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained"/>
							</ScrollViewer>
						</GroupBox>
					</ContentControl>
				</wpf:ComboBoxPopup>
			</Grid>
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger SourceName="PART_popup" Property="PopupPlacement" Value="{x:Static wpf:ComboBoxPopupPlacement.Classic}">
				<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignMultipleChoiceComboBoxItemStyle}"/>
			</Trigger>
			<Trigger Property="wpf:ComboBoxAssist.ClassicMode" Value="True">
				<Setter TargetName="PART_popup" Property="Placement" Value="Bottom"/>
				<Setter TargetName="ItemContainerGroupBox" Property="Style" Value="{DynamicResource MaterialDesignNoColorRaisedCardGroupBox}"/>
				<Setter TargetName="ItemContainerGroupBox" Property="Margin" Value="4"/>
				<Setter TargetName="ItemContainerGroupBox" Property="Padding" Value="0,2"/>
				<Setter TargetName="ItemContainerGroupBox" Property="Background" Value="{DynamicResource MaterialDesignContextMenuBackground}"/>
				<Setter TargetName="ItemContainerGroupBox" Property="MinWidth" Value="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource MathAddConverter}, ConverterParameter=15}"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="False">
				<Setter TargetName="templateRoot" Property="Opacity" Value="{StaticResource DisabledOpacity}"/>
				<Setter TargetName="toggleButton" Property="BorderBrush" Value="Transparent"/>
				<!-- <Setter TargetName="Hint" Property="HintOpacity" Value="1"/> -->
			</Trigger>
			<MultiDataTrigger>
				<MultiDataTrigger.Conditions>
					<Condition Binding="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource Self}}" Value="True"/>
					<Condition Binding="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="False"/>
				</MultiDataTrigger.Conditions>
				<Setter TargetName="InnerRoot" Property="Margin" Value="0 20 0 0"/>
			</MultiDataTrigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsDropDownOpen" Value="True"/>
					<Condition Property="wpf:ComboBoxAssist.ClassicMode" Value="False"/>
				</MultiTrigger.Conditions>
				<Setter TargetName="Underline" Property="Visibility" Value="Hidden"/>
				<Setter TargetName="toggleButton" Property="BorderBrush" Value="Transparent"/>
			</MultiTrigger>
			<!-- <MultiTrigger> -->
				<!-- <MultiTrigger.Conditions> -->
					<!-- <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False"/> -->
					<!-- <Condition Property="wpf:HintAssist.IsFloating" Value="True"/> -->
					<!-- <Condition Property="IsKeyboardFocusWithin" Value="True"/> -->
				<!-- </MultiTrigger.Conditions> -->
				<!-- <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource MidContrastPrimaryBrush}"/> -->
				<!-- <Setter TargetName="Hint" Property="HintOpacity" Value="1"/> -->
			<!-- </MultiTrigger> -->
			<!-- <MultiTrigger> -->
				<!-- <MultiTrigger.Conditions> -->
					<!-- <Condition Property="wpf:HintAssist.IsFloating" Value="True"/> -->
					<!-- <Condition SourceName="Hint" Property="IsHintInFloatingPosition" Value="True"/> -->
					<!-- <Condition Property="IsKeyboardFocusWithin" Value="True"/> -->
				<!-- </MultiTrigger.Conditions> -->
				<!-- <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource MidContrastPrimaryBrush}"/> -->
				<!-- <Setter TargetName="Hint" Property="HintOpacity" Value="1"/> -->
			<!-- </MultiTrigger> -->
			<!-- <MultiTrigger> -->
				<!-- <MultiTrigger.Conditions> -->
					<!-- <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False"/> -->
					<!-- <Condition Property="IsDropDownOpen" Value="True"/> -->
				<!-- </MultiTrigger.Conditions> -->
				<!-- <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource MidContrastPrimaryBrush}"/> -->
				<!-- <Setter TargetName="Hint" Property="HintOpacity" Value="1"/> -->
			<!-- </MultiTrigger> -->
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsGrouping" Value="true"/>
					<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
				</MultiTrigger.Conditions>
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</MultiTrigger>
			<Trigger Property="IsKeyboardFocused" Value="true">
				<Setter TargetName="Underline" Property="IsActive" Value="True"/>
			</Trigger>
			<Trigger Property="Validation.HasError" Value="true">
				<Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
				<Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
			</Trigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="Validation.HasError" Value="True"/>
					<Condition Property="wpf:ValidationAssist.Suppress" Value="True"/>
				</MultiTrigger.Conditions>
				<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)/ErrorContent}"/>
			</MultiTrigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsMouseOver" Value="true"/>
					<Condition Property="Validation.HasError" Value="true"/>
				</MultiTrigger.Conditions>
				<Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
				<Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
			</MultiTrigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsMouseOver" Value="true"/>
					<Condition Property="Validation.HasError" Value="false"/>
				</MultiTrigger.Conditions>
				<Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}"/>
				<Setter TargetName="Underline" Property="Background" Value="{DynamicResource MidContrastPrimaryBrush}"/>
			</MultiTrigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>
	
	<Style x:Key="MaterialDesignMultipleChoiceComboBoxStyle" TargetType="{x:Type DentalGUIHelper:MultipleChoiceComboBox}">
		<Style.Resources>
			<Style TargetType="{x:Type TextBlock}" BasedOn="{x:Null}"/>
		</Style.Resources>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Background" Value="{DynamicResource MaterialDesignComboBoxBackground}"/>
		<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}"/>
		<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
		<Setter Property="BorderThickness" Value="0 0 0 1"/>
		<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignMultipleChoiceComboBoxItemStyle}"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="Padding" Value="4"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="HorizontalAlignment" Value="Stretch"/>
		<Setter Property="VerticalAlignment" Value="Center"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
		<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
		<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
		<Setter Property="wpf:ValidationAssist.Suppress" Value="True"/>
		<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="1 0 1 0"/>
		<Setter Property="wpf:ComboBoxAssist.ClassicMode" Value="True"/>
		<Setter Property="wpf:HintAssist.Hint" Value="{Binding Source={StaticResource selectAnOption}, Converter={StaticResource TranslationConverter}}"/>
		<Setter Property="TextElement.FontFamily" Value="{StaticResource MaterialDesignFont}"/>
		<Setter Property="Template" Value="{StaticResource MaterialDesignFloatingHintMultipleChoiceComboBoxTemplate}"/>
		<Style.Triggers>
			<Trigger Property="IsKeyboardFocused" Value="true">
				<Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}"/>
			</Trigger>
			<Trigger Property="IsKeyboardFocusWithin" Value="true">
				<Setter Property="BorderBrush" Value="{DynamicResource MidContrastPrimaryBrush}"/>
			</Trigger>
			<!-- designer prefers hard bool -->
			<Trigger Property="wpf:ComboBoxAssist.ShowSelectedItem" Value="{StaticResource TrueValue}">
				<Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignMultipleChoiceComboBoxItemStyle}"/>
			</Trigger>
		</Style.Triggers>
	</Style>
	
	<Style x:Key="{x:Type DentalGUIHelper:MultipleChoiceComboBox}" BasedOn="{StaticResource MaterialDesignMultipleChoiceComboBoxStyle}" TargetType="{x:Type DentalGUIHelper:MultipleChoiceComboBox}" />
    
</ResourceDictionary>
